package cn.tedu.oop;

public class Test3_Inter {
    public static void main(String[] args) {
        Inter2 in = new Inter2Impl();
        in.save();
        int rows = in.updata(2);
        System.out.println(rows);

        System.out.println(in.updata(2));
        in.delete("jack");
    }
}
interface Inter1{
    void save();
    int updata(int id);
}
interface Inter3{
    void delete(String name);
}
interface Inter2 extends Inter1, Inter3{ }
class Inter3Impl implements Inter3, Inter1{

    @Override
    public void save() {
        System.out.println("保存成功！");
    }

    @Override
    public int updata(int id) {
        System.out.println("更新成功！");
        return 5;
    }

    @Override
    public void delete(String name) {
        System.out.println("删除成功！");
    }
}
class Inter2Impl implements Inter2{

    @Override
    public void save() {
        System.out.println("数据保存成功！");
    }

    @Override
    public int updata(int id) {
        System.out.println("数据已经更新！");
        return 6;
    }

    @Override
    public void delete(String name) {
        System.out.println("删除记录成功！"+name);
    }
}
